<% settings = Setting.plugin_issue_id %>
<p>
  <%= form.text_field(:issue_key, :size => 40, :disabled => @project.issue_key.present? && !@project.issue_key_changed?) %>
  <% if @project.issue_key.blank? || @project.issue_key_changed? %>
    <em class="info">
      <%= l(:text_length_between, :min => 1, :max => Project::ISSUE_KEY_MAX_LENGTH) %>
      <%= l(:text_issue_key_info) %>
    </em>
    <% if @project.children.any? && settings.is_a?(Hash) && settings[:issue_key_sharing] %>
      <%= form.check_box(:share_issue_key, :no_label => true) %>
      <%= l(:text_use_issue_key_for_subprojects) %>
    <% end %>
  <% end %>
</p>
<script type="text/javascript">
  //<![CDATA[
  <% if defined? observe_field %>
    $('project_identifier').up('p').insert({ after: $('project_issue_key').up('p').remove() });
  <% else %>
    $('#project_identifier').closest('p').after($('#project_issue_key').closest('p').remove());
  <% end %>
  //]]>
</script>
